home *** CD-ROM | disk | FTP | other *** search
/ Collection of Tools & Utilities / Collection of Tools and Utilities.iso / basic / apbsu106.zip / START.ASI < prev    next >
Text File  |  1992-01-29  |  19KB  |  915 lines

  1. start:
  2.  
  3. rem This version of START.COM is for the ApBASIC 1.7 Support Disk.
  4.  
  5. rem It requires approximately 68K of available RAM.
  6.  
  7. rem First, initialize the Esc key.  This is necessary when using parameters,
  8. rem because the menus are bypassed at first, which is where the Esc key would 
  9. rem otherwise be itialized.
  10.  
  11. b$=chr$(27)
  12.  
  13. rem Next, initialize the space bar.
  14.  
  15. e$=chr$(32)
  16.  
  17. rem Here is the routine for reading parameters from the DOS prompt.
  18.  
  19. a$=command$
  20. if a$=" /?" then help:
  21. if a$=" /v" then listfile:
  22. if a$=" /V" then listfile:
  23. if a$=" /r" then readfile:
  24. if a$=" /R" then readfile:
  25. if a$=" /p" then printdoc:
  26. if a$=" /P" then printdoc:
  27. if a$=" /d" then donation:
  28. if a$=" /D" then donation:
  29. if a$=" /40" then option40:
  30. if a$=" /40 ?" then help40:
  31. if a$=" /40 v" then listfl40:
  32. if a$=" /40 V" then listfl40:
  33. if a$=" /40 r" then rdfile40:
  34. if a$=" /40 R" then rdfile40:
  35. if a$=" /40 p" then prfile40:
  36. if a$=" /40 P" then prfile40:
  37. if a$=" /40 d" then donate40:
  38. if a$=" /40 D" then donate40:
  39.  
  40. rem If no parameters, begin from the beginning.
  41.  
  42. cls
  43. print "                       The ApBASIC 1.7 Support Disk 1.00"
  44. print
  45. print
  46. print "                                by Matt Roberts"
  47. print "                               3 Cedar St., # 8"
  48. print "                           Montpelier, Vt 05602-3006"
  49. print "                                 (802)223-2553"
  50. print
  51. print
  52. print "If you have trouble using this disk, and the documentation doesn't"
  53. print "seem to help, you can call between 9AM and 9PM EST, and I'll try to"
  54. print "help.  Keep trying."
  55. print
  56. print
  57. print "If you find the files on this disk useful, a donation of $5.00 would"
  58. print "be greatly appreciated."
  59. print
  60. print "Of course, if there's work by other authors on the disk, the $5.00"
  61. print "doesn't cover them.  Thanks for your understanding."
  62. print
  63. print
  64. print "Press any key to continue. ";
  65. gosub continue:
  66.  
  67. options:
  68. cls
  69. print "You have the following options:"
  70. print
  71. print
  72. print "F1- View a list of the files on this disk."
  73. print
  74. print "F2- View the text file of your choice, on the screen."
  75. print
  76. print "F3- Print the text file of your choice."
  77. print
  78. print "F4- Shell to DOS."
  79. print
  80. print "F5- Change to 40-column mode (larger text; probably most useful for"
  81. print "the visually impaired)."
  82. print
  83. print "F6- See a list of the parameters you can use from the DOS prompt."
  84. print
  85. print "Esc- Return to DOS."
  86. print
  87. print
  88. print "Please press the key corresponding to your choice. ";
  89.  
  90. wait1:
  91. gosub continue:
  92. if a$=b$ then finish:
  93. if extended=1 then readext:
  94. goto wait1:
  95.  
  96. rem This routine reads the keyboard, accepting only F1-F6 and the Esc key as
  97. rem valid inputs.
  98.  
  99. readext:
  100. if a$=";" then listfile:
  101. if a$="<" then readfile:
  102. if a$="=" then printdoc:
  103. if a$=">" then shell:
  104. if a$="?" then option40:
  105. if a$="@" then help:
  106. goto wait1:
  107.  
  108. rem Here is the routine for seeing a list of the files on this disk.
  109.  
  110. listfile:
  111. cls
  112. print "Here are the files on this disk:"
  113. print
  114. print
  115. print "DARKSCRN.BAS- The ApBASIC 1.7 source code for DARKSCRN.EXE."
  116. print
  117. print "DARKSCRN.EXE- A screen blanker, used from the DOS prompt."
  118. print
  119. print "DISPLAY.BAS- An ApBASIC module to display text files on the screen."
  120. print
  121. print "FILE-MAN.BAS- The ApBASIC 1.7 source code for FILE-MAN.EXE."
  122. print
  123. print "FILE-MAN.DOC- The documentation for FILE-MAN.EXE."
  124. print
  125. print "FILE-MAN.EXE- The ApBASIC 1.7 File Manager."
  126. print
  127. print "LIST.COM- A neat utility by Vern Buerg; displays files on the screen."
  128. print
  129. print "LOOSWARE.DOC- Notes on the looseware concept."
  130. print
  131. print
  132. print "Press any key to continue. ";
  133. gosub continue:
  134. cls
  135. print "START.ASI- The ASIC source code for START.COM."
  136. print
  137. print "START.COM- The file you're using right now."
  138. print
  139. print
  140. print "Press any key to return to the Main Options Menu. ";
  141. gosub continue:
  142. goto options:
  143.  
  144. rem Here is the routine for viewing text files on the screen.
  145.  
  146. readfile:
  147. cls
  148. print "To move forward in the file(s) you are about to view, press PgDn."
  149. print
  150. print "To move back, press PgUp."
  151. print
  152. print "To exit the file, press Esc."
  153. print
  154. print
  155. print "Press any key to see the menu of files."
  156. gosub continue:
  157. readmenu:
  158. cls
  159. print "Here are the files you can view:"
  160. print
  161. print
  162. print "A- DARKSCRN.BAS"
  163. print
  164. print "B- DISPLAY.BAS"
  165. print
  166. print "C- FILE-MAN.BAS"
  167. print
  168. print "D- FILE-MAN.DOC"
  169. print
  170. print "E- NOT IN USE"
  171. print
  172. print "F- LOOSWARE.DOC"
  173. print
  174. print "G- START.ASI"
  175. print
  176. print "Esc- Return to the Main Options Menu."
  177. print
  178. print
  179. print "Please press the key corresponding to your choice. ";
  180. gosub continue:
  181. if a$=b$ then options:
  182. print a$;
  183. if a$="g" then readstar:
  184. if a$="G" then readstar:
  185. if a$="f" then readloos:
  186. if a$="F" then readloos:
  187. if a$="e" then readmenu:
  188. if a$="E" then readmenu:
  189. if a$="d" then readfild:
  190. if a$="D" then readfild:
  191. if a$="c" then readfilb:
  192. if a$="C" then readfilb:
  193. if a$="b" then readdisb:
  194. if a$="B" then readdisb:
  195. if a$="a" then readdarb:
  196. if a$="A" then readdarb:
  197. goto readmenu:
  198.  
  199. readdarb:
  200. call ("list.com"," darkscrn.bas")
  201. goto readmenu:
  202. readdisb:
  203. call ("list.com"," display.bas")
  204. goto readmenu:
  205. readfilb:
  206. call ("list.com"," file-man.bas")
  207. goto readmenu:
  208. readfild:
  209. call ("list.com"," file-man.doc")
  210. goto readmenu:
  211. readloos:
  212. call ("list.com"," loosware.doc")
  213. goto readmenu:
  214. readstar:
  215. call ("list.com"," start.asi")
  216. goto readmenu:
  217.  
  218. rem Here is the routine for printing text files.
  219.  
  220. printdoc:
  221. cls
  222. print "Please ready your printer; press any key to see the menu of files. ";
  223. gosub continue:
  224.  
  225. printmen:
  226. cls
  227. print "Here are the files you can print:"
  228. print
  229. print
  230. print "A- DARKSCRN.BAS"
  231. print
  232. print "B- DISPLAY.BAS"
  233. print
  234. print "C- FILE-MAN.BAS"
  235. print
  236. print "D- FILE-MAN.DOC"
  237. print
  238. print "E- NOT IN USE"
  239. print
  240. print "F- LOOSWARE.DOC"
  241. print
  242. print "G- START.ASI"
  243. print
  244. print "Esc- Return to the Main Options Menu."
  245. print
  246. print
  247. print "Please press the key corresponding to your choice. ";
  248.  
  249. wait5:
  250. gosub continue:
  251. if a$=b$ then options:
  252. if a$="g" then printsta:
  253. if a$="G" then printsta:
  254. if a$="f" then printloo:
  255. if a$="F" then printloo:
  256. if a$="e" then printmen:
  257. if a$="E" then printmen:
  258. if a$="d" then printfid:
  259. if a$="D" then printfid:
  260. if a$="c" then printfib:
  261. if a$="C" then printfib:
  262. if a$="b" then printdib:
  263. if a$="B" then printdib:
  264. if a$="a" then printdab:
  265. if a$="A" then printdab:
  266. goto wait5:
  267.  
  268. printdab:
  269. file$="darkscrn.bas"
  270. gosub printfil:
  271. goto printmen:
  272.  
  273. printdib:
  274. file$="display.bas"
  275. gosub printfil:
  276. goto printmen:
  277.  
  278. printfib:
  279. file$="file-man.bas"
  280. gosub printfil:
  281. goto printmen:
  282.  
  283. printfid:
  284. file$="file-man.doc"
  285. gosub printfil:
  286. goto printmen:
  287.  
  288. printloo:
  289. file$="loosware.doc"
  290. gosub printfil:
  291. goto printmen:
  292.  
  293. printsta:
  294. file$="start.asi"
  295. gosub printfil:
  296. goto printmen:
  297.  
  298.  
  299. rem Here is the routine for printing a file.
  300.  
  301. printfil:
  302. cls
  303. f$=chr$(12)
  304. open "i",1,file$
  305.  
  306. if error=2 then
  307. print ""
  308. print ""
  309. print "File not found."
  310. print
  311. print
  312. print "Press any key to continue. ";
  313. gosub continue:
  314. close 1
  315. return
  316. endif
  317.  
  318. heading:
  319. cls
  320. print "Printing...";
  321. realfile$=ucase$(file$)
  322. color 0,7
  323. print realfile$
  324. color 7,0
  325. print
  326. print
  327. print "Press space bar to pause printing, or Esc to quit."
  328. print
  329. print
  330.  
  331. printmor:
  332. input# 1, line$ crlf
  333.  
  334. if error=96 then
  335. lprint line$
  336. goto blanklin:
  337. endif
  338.  
  339. contlprn:
  340. lprint line$
  341.  
  342. a$=inkey$
  343.  
  344. if a$=b$ then
  345. print "Printing has been terminated.  The printer may still have data in its"
  346. print "buffer.  If so, it will continue printing until the buffer is empty."
  347. print
  348. lprint f$
  349. close 1
  350. file$=""
  351. print "Press any key to continue. ";
  352. gosub continue:
  353. return
  354. endif
  355.  
  356. if a$=e$ then pause: else nopause:
  357.  
  358. pause:
  359.  
  360. print "Press any key to resume printing. ";
  361.  
  362. pausemor:
  363. a$=inkey$
  364. if a$="" then pausemor:
  365. a$=""
  366. goto heading:
  367.  
  368. nopause:
  369. if error=99 then eofp:
  370. goto printmor:
  371.  
  372. blanklin:
  373. input# 1, line$ crlf
  374. if line$="" then printmor: else contlprn:
  375.  
  376. eofp:
  377. lprint line$
  378. print "Finished."
  379. print
  380. close 1
  381. lprint f$
  382. print "Press any key to continue. ";
  383. gosub continue:
  384. return
  385.  
  386.  
  387. rem This is the end of the routi